import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:xvideos/assets_tool/images.dart';
import 'package:xvideos/hj_page/home_business/search_page/search_main_logic.dart';
import 'package:xvideos/hj_page/home_business/search_page/search_main_page.dart';
import 'package:xvideos/hj_utils/widget_utils.dart';

import '../../home_main_logic.dart';

class CommonSearchBarView extends StatelessWidget {
  final bool isDarkStyle;
  final HomeMainLogic? logic;

  const CommonSearchBarView({
    super.key,
    this.isDarkStyle = false,
    this.logic,
  });

  @override
  Widget build(BuildContext context) {
    return Row(
      children: [
        16.w.sizeBoxW,
        Image.asset(
          'app_main_logo.webp'.commonImgPath,
          height: 24,
        ),
        Spacer(),
        InkWell(
          onTap: () => Get.to(SearchMainPage<VideoSearchMainController>()),
          child: Image.asset(
            'search_icon.png'.commonImgPath,
            width: 24,
            color: Color(0xff989898),
          ),
        ),
        12.sizeBoxW,
        Builder(builder: (_) {
          return InkWell(
            onTap: () {
              logic?.openEndDrawer();
            },
            child: Image.asset(
              'acg_menu.png'.acgImgPath,
              width: 24,
              color: Color(0xff989898),
            ),
          );
        }),
        16.sizeBoxW,
      ],
    );
  }
}
